package com.itheima.service.impl;

import com.itheima.dao.UserRoleMapper;
import com.itheima.domain.Role;
import com.itheima.domain.User;
import com.itheima.service.UserRole;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import java.util.Map;

@Service
public class UserRoleImpl implements UserRole {
    @Autowired
    private UserRoleMapper userRoleMapper;

    @Override
    public User queryUserInfo(String uid) {
        int it=1;
        return userRoleMapper.queryUserInfo(uid);
    }

    @Override
    @Transactional(rollbackFor = Exception.class)
    public String addUserRole(User user) {
        userRoleMapper.addUser(user);
        userRoleMapper.addUserRole(1,user.getId());
        return "12";
    }

}
